package com.api.mapper;

import com.api.pojo.Building;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface BuildingMapper {

    @Select("select * from building where id = #{id}")
    Building getById(Integer id);

    @Insert("insert into building(label) value(#{label})")
    void create(String label);

    @Delete("delete from building where id = #{id}")
    void remove(Integer id);

    @Update("update building set label = #{label} where id = #{id}")
    void update(Integer id, String label);

    @Select("select * from building limit #{pageNo}, #{pageSize}")
    List<Building> get(Integer pageNo, Integer pageSize);

    @Select("select count(*) from building")
    Integer count();

    @Select("select * from building")
    List<Building> getAll();

}
